<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>发表帖子</title>
<script src="../js/main.js" type="text/javascript">

</script>
<style>
	.button {
    	background-color: #FF7701; /* Green */
    	border: none;
    	color: white;
    	padding: 10px 15px;
    	text-align: center;
    	text-decoration: none;
    	display: inline-block;
    	font-size: 15px;
    	margin: 10px 10px;
    	cursor: pointer;
    	border-radius:8px;
    	-webkit-transition-duration: 0.4s; /* Safari */
    	transition-duration: 0.4s;
}
	.button1
	{
		background-color: #FF7701; 
	}

	.button1:hover
	{
		border-radius:8px;
		cursor: pointer;
		background-color: #008CBA; 
	}
</style>
</head>
<link href="../css/css.css" rel="stylesheet">

<body bgcolor="#F7F7F7">
<script src="../js/jquery-2.1.4.min.js" type="text/javascript">
</script>
<div class="Body">
	<div class="Body_logo">
    <a href="../index.html"><img src="../img/logo.png"></a>
    </div>
    <div class="Body_Serach">
    	<div style="border:0px solid red;margin:32px auto;text-align:center;">
    	<input type="text" style="height:25px;width:200px;font-family:bahnschrift;float:none;margin:1px;border-radius:10px;border-color:#FF7F00;">
        <input type="button" name="serach" style="font-size:20px;font-family:bahnschrift;position:relative;top:2px;border-radius:10px;background-color:#FF7F00;box-shadow:2px 2px 2px #FF7F00;"  value="Search">
        </div>
    </div>
    <div style="border:0px solid red;width:150px;height:100px;float:left;">
    		<span style="font-size:12px;">荣誉奖项：<br>
            <a href="https://www.mi.com" target="_blank">全网最热门网站</a><br>
            <a href="https://www.rom.com" target="_blank">安卓开源联盟网站成员</a><br>
            <a href="https://www.rom.com" target="_blank">B&A开发大奖第一名</a><br>
            <br>
            </span>
    </div>
     <div style="border:0px solid red;width:60px;height:100px;float:left;" id="controlpanel">
    		
    </div>
    <div style="border:0px solid red;width:100%;height:42px;float:left;">
      <div id="nav">
    		<ul id="Loginfo">
      			<li><a href="index.html" title="首页">首页</a></li>
      			<li><a href="phonelist.html" title="机型列表">机型列表</a></li>
      			<li><a href="usergroup.html" title="申请用户组">申请用户组</a></li>
      			<li><a href="newslist.html" title="玩机心得">玩机心得</a></li>
     	 		<li><a href="information.html" title="信息管家(原安全中心)">信息管家</a></li>
      			<li><a href="port.html" title="反馈吐槽">反馈吐槽</a></li>
      			<li style="float:right;"><a href="#" title="广告"><img alt="广告" src="../img/ad.gif" height="20"></a></li>
      			<li style="float:right;"><a href="#" title="广告2"><img alt="广告2" src="../img/ad2.gif" height="20"></a></li>
    		</ul>
  	  </div>
</div>
<div style="border:0px solid red;width:100%;height:10px;float:left;border-radius:8px;">
</div>
<div style="border:0px solid red;width:100%;height:465px;float:left;border-radius:8px;">
	<div style="border:0px solid red;width:74.6%;height:500px;float:left;border-radius:8px;">
		<div style="border:0px solid red;width:100%;height:60px;float:left;border-radius:8px;">
			<input type="text" id="title" style="width:99%;height:53px;border-radius:8px;font-size:30px;text-align:center;" placeholder="请输入文章标题">
		</div>
		<div  style="border:0px solid red;width:100%;height:338px;float:left;border-radius:8px;" id="editor"></div>
		<div  style="border:0px solid red;width:100%;height:60px;float:left;border-radius:8px;">
			<div style="border:0px solid red;width:85%;height:60px;float:left;border-radius:8px;">
				请选择发布的板块：
				<select style="border:1px solid red;margin-top:20px;" id="s1">
					<option value="PL001">玩机心得</option>
					<option value="PP001">小米手机</option>
					<option value="PP002">红米手机</option>
					<option value="PP003">OPPO手机</option>
					<option value="PP004">VIVO手机</option>
					<option value="PP005">华为手机</option>
					<option value="PP006">荣耀手机</option>
					<option value="PP007">一加手机</option>
					<option value="PP008">努比亚手机</option>
				</select>
			</div>
			<div style="margin-left:690px;"><button class="button button1" id="addposts">发表</button></div>
		</div>
	</div>

	<div style="border:0px solid red;width:25%;height:465px;float:left;border-radius:8px;">
		<img src="../img/gg.png" title="公益广告">
	</div>
</div>
<div style="border:0px solid red;width:1030px;height:20px;float:left;">
</div>  
<div style="width:1030px;height:23px;border:0px solid red;float:left;">
</div>
<div style="border:0px solid red;width:1030px;height:122px;float:left;">
<div style="font-size:13px;text-align:center;"><a href="#">关于本站</a>&nbsp;|&nbsp;<a href="#">服务协议</a>&nbsp;|&nbsp;<a href="#">隐私政策</a>&nbsp;|&nbsp;<a href="#">开放平台</a>&nbsp;|&nbsp;<a href="#">商务洽谈</a>&nbsp;|&nbsp;<a href="#">安卓开源许可证</a>&nbsp;|&nbsp;<a href="#">版权所有</a>&nbsp;<br>
&copy;2019 AndroidPhoneBBS&nbsp;安卓手机刷机论坛&reg;<br>
<a href="#">粤网文[2017]6138-1456号</a> <a href="#">新出网证（粤）字010号</a> <a href="#">网络视听许可证1904073号</a> 增值电信业务经营许可证：<a href="#">粤B2-20090059 </a><a href="#">B2-20090028</a><br>
<br>
<img src="../img/备案.png">
&nbsp;<img src="../img/举报.png">
&nbsp;<img src="../img/文明.png">
&nbsp;<img src="../img/验证.png">
&nbsp;<img src="../img/网监.png">
</div>
</div>
</div>

</body>
<script type="text/javascript" src="../js/wangEditor.min.js"></script>
    <script type="text/javascript">
        var E = window.wangEditor
        var editor = new E('#editor')
        // 或者 var editor = new E( document.getElementById('editor') )
        editor.create()
        $('#addposts').on('click',function(){
        	if($('#act').html() == null){
        		alert("你还未登录哦，先去登录吧！");
				window.location = "Login.html";
        	}else{
        		//alert($('#act').html());
        		var form = {
        				"ptheme":$('#title').val(),
        				"ptext":editor.txt.html(),
        				"account":$('#act').html(),
        				"unick":$('#account').val(),
        				"plate":$('#s1').val()
        		}
        		//?ptheme='+$('#title').val()+'&ptext='+editor.txt.html()+'&account='+$('#act').html()+'&unick='+$('#account').val()+'&plate='+$('#s1').val()
        		$.ajax({
        			url:'../add_posts',
        			method:'post',
        			data:form,
        			success:function(result){
        				$.ajax({
        					url:'../update_points?uid='+$('#aid').val(),
        					method:'get',
        					success:function(result){
        						
        					}
        					
        				})
        				alert(result);
        				window.location = "phonelist.html";
        			}
        		})
        	}
        		
	})
    </script>
<script type="text/javascript">
$(function(){
	
	$.ajax({
		url:'../logins',
		method:'post',
		success:function(results){
			//alert(results);
			if(results == null){
				$('#controlpanel').append(
						'<span style="font-size:12.5px;text-align:center;"><a href="../page/Register.html">注册账户</a><br>'+
			            '</span>'+
			            '<span style="font-size:12.5px;text-align:center;"><a href="../page/Login.html">登录账户</a><br>'+
			            '</span>'
					);
			}else{
				$('#controlpanel').css("display","none");
				$('#Loginfo').append(
						'<li><a href="../page/information.html" id="act">'+results.u_account+'</a></li>'+
						'<li><a href="../logout" >'+"退出"+'</a></li>'+
						'<input id="aid" type="hidden" value="'+results.u_uid+'"/>'
				)
			}
			var id = results.u_uid;
			//alert(id);
			if(id != null){
				$.ajax({
					//alert(results.u_uid);
					url:'../get_user_info?uid='+results.u_uid,
					method:'get',
					success:function(result){
						$('#Loginfo').append(
								'<input id="account" type="hidden" value="'+result.u_nick+'"/>'
							)
						}
					})
			}else{
				
			}
			
	}
	
});	
	
	
	
	
	
});
</script>
</html>
